package edu.java.homework.hw08.ipj08.exer01done;

public class RavnobedrenTriangle extends RavnostranenTriangle {

    // --- Instance Variable ---------------------------------------------------
    double side2 = 0.0d;

    // --- Constructors --------------------------------------------------------

    public RavnobedrenTriangle() {
	this(0, 0);
    }

    public RavnobedrenTriangle(double side1, double side2) {
	super(side1);
	this.side2 = side2;
    }

    // --- Getters and Setters -------------------------------------------------
    public double getSide2() {
	return side2;
    }

    public void setSide2(double side2) {
	this.side2 = side2;
    }

    // --- Methods Override ----------------------------------------------------

    @Override
    public double getPerimeter() {
	return getSide1() + (getSide2() * 2);
    }

    @Override
    public double getSurface() {
	double semiP = getPerimeter() / 2;
	double tempNumb = semiP * (semiP - getSide1())
		* Math.pow(semiP - getSide2(), 2);
	return Math.sqrt(tempNumb);
    }
    
    @Override
    public String toString(){
	StringBuffer sb=new StringBuffer();
	sb.append(super.toString()).append("\n");
	sb.append("side2: ").append(getSide2());
	return sb.toString();
    }
    
}
